package com.tea.api;

import com.tea.common.dto.DiscountCouponAddDto;
import com.tea.common.vo.R;
import com.tea.feign.DiscountCouponService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = "优惠券相关")
@RestController
@RequestMapping("/api/discountcoupon/")
public class DiscountCouponApi {
    @Resource
    private DiscountCouponService service;
    @ApiOperation("新增消费券")
    @PostMapping("add.do")
    public R add(@RequestBody DiscountCouponAddDto dto){
        return service.add(dto);
    }
    @ApiOperation("查询全部优惠券")
    @GetMapping("sel.do")
    public R sel(){
        return service.sel();
    }
}
